<!DOCTYPE html>
<meta charset="utf-8">
<title>crash when closing a MessagePort - iframe</title>
<script>
var worker = new SharedWorker(URL.createObjectURL(new Blob([
    'onconnect = e => {' +
    '  for (let i = 0; i < 10; i++) { e.ports[0].postMessage({}); }' +
    '};'
  ], {'type': 'text/javascript'})));
worker.port.onmessage = () => {
  window.parent.done();
};
</script>
